<?php 
defined( '_JEXEC' ) or die( 'Restricted access' );
JHTML::_('behavior.modal', 'a.modal');
?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
    <table class="adminlist">
      <thead>
        <tr>
          <th width="2%"> <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $this->lists ); ?>);" />
          </th>
          <th width="10%">Order number</th>
          <th width="20%">Order date</th>
          <th width="40%">Name</th>
          <th width="10%">Detail</th>
        </tr>
      </thead>
      <?php
	$k = 0;
	for ($i=0, $n=count( $this->lists); $i < $n; $i++)
	{	
		$row = &$this->lists[$i];
		$checked 	 = JHTML::_('grid.id',   $i, $row->order_id );
		$link 		 = JRoute::_( 'index.php?option=com_auction&task=edit&cid[]='. $row->id );
		$tmp = explode(' ', $row->date);
		$tmp1 = explode('-', $tmp[0]);
		$date = $tmp1[2].'-'.$tmp1[1].'-'.$tmp1[0];
		?>
      <tr class="<?php echo "row$k"; ?>">
      	<td align="center"><?php echo $checked; ?></td>
        <td align="center"><?php echo $row->order_id;?></td>
        <td align="center"><?php echo $date; ?></td>
        <td align="center"><?php echo $row->name; ?></td>
        <td align="center"><strong><?php echo $row->userNum; ?></strong> <a class="modal" rel="{handler: 'iframe', size: {x: 800, y: 450}}" href="../index.php?option=com_ecommerce&view=detail&layout=order&tmpl=component&id=<?php echo $row->order_id;?>"> (Click here to view detail)</a></td>
      </tr>
      <?php
		$k = 1 - $k;
	}
	?>
      <tr>
        <td colspan="5"><?php echo $this->page->getListFooter(); ?> </td>
      </tr>
    </table>
</div>
  <input type="hidden" name="option" value="com_auction" />
  <input type="hidden" name="task" value="" />
  <input type="hidden" name="boxchecked" value="0" />
  <input type="hidden" name="controller" value="orders" />
</form>